home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
sos3-2.lha
/
src
/
knl
/
knl.sos
< prev
Wrap
Text File
|
1991-10-29
|
4KB
|
154 lines
/* --------------------------------------------------------------------------
* Copyright 1992 by Forschungszentrum Informatik (FZI)
*
* You can use and distribute this software under the terms of the licence
* you should have received along with this program.
* If not or if you want additional information, write to
* Forschungszentrum Informatik, "STONE", Haid-und-Neu-Strasse 10-14,
* D-7500 Karlsruhe 1, Germany.
* --------------------------------------------------------------------------
*/
/* ************************************************************************ */
/* SOS kernel classes */
/* **************************** ************** **************************** */
schema knl
{
extern void (0);
extern sos_Int (4);
extern sos_Char (1);
extern sos_Cstring (4);
extern sos_Pointer (4);
extern sos_Container (4);
extern sos_Id (8);
extern sos_Offset (4);
enum sos_Bool { FALSE, TRUE };
enum sos_Eq_kind { EQ_STRONG, EQ_WEAK };
enum sos_Comp_result { CMP_LESS, CMP_EQUAL, CMP_GREATER };
// *************************** sos_Object ****************************
class sos_Object
{
public:
sos_Type type ();
sos_Bool has_type (sos_Type);
sos_Bool isa (sos_Type);
sos_Bool is_some (sos_Type);
sos_Bool is_value ();
sos_Int size ();
sos_Bool identical (sos_Object);
sos_Bool operator== (sos_Object);
sos_Bool operator!= (sos_Object);
sos_Bool like (sos_Object);
sos_Comp_result compare_ids (sos_Object);
protected:
static void local_assign (sos_Object, sos_Object);
static sos_Bool local_equal (sos_Object, sos_Object, sos_Eq_kind);
static sos_Int local_hash_value (sos_Object);
private:
sos_Id type_id;
}; // ** sos_Object **
// *********************** sos_Ordered_object ************************
class sos_Ordered_object
{
public:
abstract sos_Comp_result compare (sos_Ordered_object);
sos_Bool operator< (sos_Ordered_object);
sos_Bool operator<= (sos_Ordered_object);
sos_Bool operator> (sos_Ordered_object);
sos_Bool operator>= (sos_Ordered_object);
}; // ** sos_Ordered_object **
// *********************** sos_Scalar_object *************************
class sos_Scalar_object
{
protected:
static void local_initialize (sos_Scalar_object);
static void local_finalize (sos_Scalar_object);
static void local_assign (sos_Scalar_object, sos_Object);
static sos_Bool local_equal (sos_Scalar_object, sos_Object, sos_Eq_kind);
static sos_Int local_hash_value (sos_Scalar_object);
}; // ** sos_Scalar_object **
// **************************** sos_String *****************************
class sos_String : sos_Ordered_object
{
public, private set:
sos_Int length;
public:
sos_Cstring make_Cstring (); // converts to an sos_Cstring
void assign_Cstring (sos_Cstring); // assigns an sos_Cstring
void operator+= (sos_String); // appends an sos_String
// ** Redefinitions **
sos_Int size (); // (-> sos_Object)
sos_Comp_result compare (sos_Ordered_object); // (-> sos_Ordered_object)
protected:
static void local_initialize (sos_String);
static void local_finalize (sos_String);
static void local_assign (sos_String, sos_Object);
static sos_Bool local_equal (sos_String, sos_Object, sos_Eq_kind);
static sos_Int local_hash_value (sos_String);
private:
sos_Offset address;
}; // ** sos_String **
// *************************** sos_Named *****************************
class sos_Named
{
public:
abstract sos_String get_name ();
abstract void set_name (sos_String);
}; // ** sos_Named **
// **************************** sos_Type *****************************
class sos_Type : sos_Named
{
public:
sos_String name;
sos_Int object_size;
sos_Bool is_derived_from (sos_Type);
sos_Bool is_derived_from_some (sos_Type);
sos_Bool is_scalar ();
sos_Type base ();
sos_Type root ();
}; // ** sos_Type **
} // ** schema knl **